<html>
<head>
    <script type="text/javascript" src="js/jquery-2.0.2.min.js"></script>
</head>

<body>  

<button id="ajax">ajax call</button>
<button id="json">json</button>

<script type="text/javascript">

    $('#ajax').click(function(){ 
        alert('ajax');
         $.ajax({ 
             type: "GET",
             dataType: "json",
             url: "http://127.0.0.1/cancha/api/index.php/canchas/1",
             success: function(data){        
                alert(data);
             }
         });
    });

</script>